<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <p @click="num ++">{{num}}</p>
        <button @click="$destroy()">销毁</button>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        const vm = new Vue({
            data: {
                num: 0,
            },
            beforeCreate() {
                console.log("beforeCreate()");
            },
            created() {
                console.log("created()");
            },
            beforeMount() {
                console.log("beforeMount()");
            },
            mounted() {
                console.log("mounted()");
            },
            beforeUpdate() {
                console.log("beforeUpdate()");
            },
            updated() {
                console.log("updated()");
            },
            beforeDestroy() {
                console.log("beforeDestroy()");
            },
            destroy() {
                console.log("destroy()");
            }
        });
        vm.$mount("#app");
    </script>
</body>

</html>